-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for compiling with MSVC #97
base: master
Are you sure you want to change the base?
Conversation
Reference: https://developercommunity.visualstudio.com/t/error-c2872-byte-ambiguous-symbol/93889 The reason is that the Ghidra developers for some reason decided to put "using namespace std;" in their header files.
Thank you so much for this PR and for your interest in Maat! Everything looks good to me. It would be really amazing if you could integrate windows in the Github Actions CI before we merge this. Also, is there anything specific worth mentioning in BUILDING.md or HACKING.md for Windows builds? |
Not really, the only thing I did was use vcpkg to get GMP. I can add some instructions, but there’s nothing platform specific. I’ll try also building with lief and z3 for completeness sake and then add GH actions. |
Awesome! No need to update the documentation then. Looking forward to seeing progress on this. Don't hesitate to ask if you have more questions. |
I ran into some issues compiling maat with z3 and lief, will get back to it once I figure out what's going on. |
@mrexodia Not sure if you're planning to use vcpkg for Z3 and LIEF, but I have pending PR for LIEF on vcpkg here[1]. It's pending/blocked because LIEF requires mbedtls v3 but other vcpkg ports require mbedtls v2 and aren't the easiest to upgrade/support both major versions 😞 . The failing tests are related to the other vcpkg ports that don't support mbedtls v3. Moreover, I think the move to use vcpkg for all of CI would make building dependencies easier when supporting multiple OSes. I plan to work on this when I find the time, but I also need to figure out how to ensure OS compatibility with the native Python wheels, i.e. adding |
Thanks! For vcpkg it should be possible to use manifest mode and then an overlay for mbedtls v3 and lief. I was trying to stay compatible with the current LIEF version used, but this version doesn't compile with MSVC so I will upgrade to the latest LIEF/Z3 and provide vcpkg overlays. |
@mrexodia I finally found some time to work on vcpkg support for sleigh and have opened a draft PR for maat to use dependencies all from vcpkg here #128. I also tested the vcpkg integration on Windows and the dependencies all seem to build fine. I also merged this branch into a test branch with the vcpkg integration, but I'm getting some additional errors in Maat that I think have been introduced since you first opened this PR.
diff --git a/generate/src/include/maat/config.hpp.in b/generate/src/include/maat/config.hpp.in
index 3de9b6e..6d0266c 100644
--- a/generate/src/include/maat/config.hpp.in
+++ b/generate/src/include/maat/config.hpp.in
@@ -1,8 +1,8 @@
#ifndef MAAT_CONFIG_H
#define MAAT_CONFIG_H
-static constexpr char* maat_install_prefix = "@CMAKE_INSTALL_PREFIX@";
-static constexpr char* maat_specfile_dir_prefix = "@maat_INSTALL_DATADIR@/@spec_out_prefix@";
+static constexpr auto maat_install_prefix = "@CMAKE_INSTALL_PREFIX@";
+static constexpr auto maat_specfile_dir_prefix = "@maat_INSTALL_DATADIR@/@spec_out_prefix@";
#include <filesystem>
#include <list>
Feel free to mess around with the vcpkg integration. I've left some TODOs in #128 of what I was planning, but I won't get to working on that again for 2 weeks or so. |
Thanks for picking this up, I lost track of it. I have the PR marked as editable by collaborators so feel free to push any fixes you might have. Otherwise I’ll pick it up some time in the future. |
Mostly a draft to see if there is interest. The changes are quite minimal, the only functional change I made was the
mulhshr
function because MSVC doesn't supportuint128_t
. I made a pretty extensive test harness for the MSVC implementation though: https://godbolt.org/z/h9q7hj5P1If this is something you would merge I can do CI with GitHub Actions for Windows as well.